package com.appjishu.web.controller;

import com.appjishu.web.biz.service.LoginService;
import com.appjishu.web.model.LoginResult;
import com.appjishu.web.model.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/** 
* @author echo(goldliclass@163.com)
* @version 创建时间：2022年8月26日 下午11:21:36 
* 类说明 
*/
@Api(tags = "登录接口")
@RequestMapping("passport")
@Controller
@CrossOrigin
public class PassportController {
	@Autowired
	private LoginService loginService;

	@ApiOperation(value = "登录", notes = "账号密码状态")
	@PostMapping("/login")
	@ResponseBody
	public LoginResult login(String username, String password, Integer accountType) {
		LoginResult loginResult = loginService.login(username, password, accountType);

		return loginResult;
	}
	@ApiOperation(value = "注册", notes = "手机号密码状态")
	@PostMapping("/register")
	@ResponseBody
	public LoginResult register(String username, String password, Integer accountType) {
		LoginResult loginResult = loginService.register(username, password, accountType);
		return loginResult;
	}
}
